Class XmlStreamReaderWrapper

java.lang.Object
eu.europa.ec.taxud.cesop.readers.XmlStreamReaderWrapper

public final class XmlStreamReaderWrapper extends Object
Wrapper for stream reader.
  • Constructor Details

  • Method Details

    • markAsPeek

      public void markAsPeek()
      Mark as peek.
    • hasNext

      public boolean hasNext() throws XMLStreamException
      Returns true if there are more parsing events and false if there are no more events. This method will return false if the current state of the XMLStreamReader is END_DOCUMENT.
      Returns:
      true if there are more events, false otherwise
      Throws:
      XMLStreamException - in case of error while processing the XML content
    • moveToNextElement

      public void moveToNextElement() throws XMLStreamException
      Moves to the next element. This method will throw an IllegalStateException if it is called after hasNext() returns false.
      Throws:
      XMLStreamException - in case of error while processing the XML content
    • isStartElement

      public boolean isStartElement()
      Returns true if the current event type is a start element, false otherwise.
      Returns:
      true if the current event type is a start element.
    • isCharactersElement

      public boolean isCharactersElement()
      Returns true if the current event type is a characters element or a CDATA section, false otherwise.
      Returns:
      true if the current event type is a characters element or a CDATA section.
    • isEndElement

      public boolean isEndElement()
      Returns true if the current event type is an end element, false otherwise.
      Returns:
      true if the current event type is an end element.
    • goToNextStartElement

      public boolean goToNextStartElement() throws XMLStreamException
      Goes to the next XML start element.
      Returns:
      true if a start element is found, false otherwise
      Throws:
      XMLStreamException - in case of error while processing the XML content
    • goToNextStartElement

      public boolean goToNextStartElement(QName qName) throws XMLStreamException
      Goes to the next XML start element with specified QName.
      Parameters:
      qName - the name of the start element to search for
      Returns:
      true if the start element is found, false otherwise
      Throws:
      XMLStreamException - in case of error while processing the XML content
    • getStartElementName

      public QName getStartElementName() throws XMLStreamException
      Returns the current start tag name.
      Returns:
      the tag name
      Throws:
      XMLStreamException - if the current event type is not a start element
    • getEndElementName

      public QName getEndElementName() throws XMLStreamException
      Returns the current end tag name.
      Returns:
      the tag name
      Throws:
      XMLStreamException - if the current event type is not an end element
    • getCharacters

      public String getCharacters() throws XMLStreamException
      Returns the element characters.
      Returns:
      the element characters
      Throws:
      XMLStreamException - if the current event type is not a characters element
    • getAttributes

      public Map<String,String> getAttributes() throws XMLStreamException
      Returns the list of attributes.
      Returns:
      a list of attributes (name, value)
      Throws:
      XMLStreamException - if the current event type is not an attribute element